#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define XH(i,a,b) for(int i = a; i < b; ++i)
#define XXH(i,b,a) for(int i = b; i >= a; --i)
#define Module 998244353
int tmpInt;ll tmpll;string tmpStr;char tmpChar;
vector<int>tmpIntVector;

int NotPrimes[100100];

int main(){
  int n , maxp; 
  cin>>n>>maxp;
  for(int i = 2; i <= maxp; ++i){
    if(NotPrimes[i] == 0)
      for(int j = i + i; j <= maxp; j+=i){
        NotPrimes[j] = 1;
      }
  }
  vector<int>primes;
  for(int i = 2 ; i <= maxp ; ++i){
    if(NotPrimes[i] == 0) primes.push_back(i);
  }
  int size = primes.size();
  if( n == 1){
    printf("%d",primes[size - 1]);
    return 0;
  }
  vector<int>ans(n);
  int maxdiff = 0;
  for(int i = size - 1 ; i >= 0 ; --i){
    for(int j = 0 ; j < i - n + 1 ; ++j){
      int left = primes[j] , right = primes[i];
      if((right-left)%(n-1))continue;
      int difference = (right - left)/(n-1);
      int yes = 1;
      for(int k = left + difference; k<right; k+=difference){
        if(NotPrimes[k] == 1){
          yes = 0;
          break;
        }
      }
      if(yes){
        if(difference>maxdiff || (difference == maxdiff && left > ans[0])){
              maxdiff = difference;
              ans.clear();
              int index = 0;
              for(int k = left; k <= right ; k += difference){
                ans[index++] = k;
              }
            }
      }
    }
  }
  if(maxdiff == 0){
    printf("%d",primes[size - 1]);
  }else{
    XH(i,0,n)printf("%d%c",ans[i],i == n-1?'\n':' ');
  }
  return 0;
}
